package atguigu.ScadaEquipCheckNodeInfoUtils;

import org.apache.commons.lang.StringUtils;

public class EquipScadaNode  {


    public static String EQUIPMENT_NUMBER = "equipmentNumber";
    public static String EQUIP_A_CODE = "equipACode";
    public static String CHECK_CODE = "checkCode";
    public static String TYPE = "type";
    public static String WORK_LOCATION = "workLocation";

    // 设备编号

    private String equipmentNumber;
    // A码

    private String equipACode;

    // 检测点编号

    private String checkCode;

    // 类别

    private String type;

    // 工位

    private String workLocation;


    public String getEquipmentNumber() {
        return equipmentNumber;
    }

    public void setEquipmentNumber(String equipmentNumber) {
        this.equipmentNumber = equipmentNumber;
    }

    public String getEquipACode() {
        return equipACode;
    }

    public void setEquipACode(String equipACode) {
        this.equipACode = equipACode;
    }

    public String getCheckCode() {
        return checkCode;
    }

    public void setCheckCode(String checkCode) {
        this.checkCode = checkCode;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWorkLocation() {
        return workLocation;
    }

    public void setWorkLocation(String workLocation) {
        this.workLocation = workLocation;
    }
    
    public void initEquipNumber() {
        if(StringUtils.isNotBlank(this.equipACode) && StringUtils.isNotBlank(this.checkCode)){
            String aString = this.equipACode;
            String string = this.checkCode;
            String substring = string.substring(string.length()-8,string.length());
//            System.out.println(substring);
            String substring2 = substring.substring(0,6);
//            System.out.println(substring2);
            String realString = "T"+aString+substring2;
//            System.out.println(realString);
            this.setEquipmentNumber(realString);
        }
    }

    
}